package com.seckill.goods.task.dynamic;

import com.dangdang.ddframe.job.executor.ShardingContexts;
import com.dangdang.ddframe.job.lite.api.listener.AbstractDistributeOnceElasticJobListener;
import com.seckill.util.TimeUtil;

import java.util.Date;

/**
 * @program: seckill-parent
 * @description: 监听器创建, 任务执行前后监听
 * @author: zhanghz001
 * @create: 2021-06-27 11:16
 **/

public class ZhzElasticJobListener extends AbstractDistributeOnceElasticJobListener {
    public ZhzElasticJobListener(long startedTimeoutMilliseconds, long completedTimeoutMilliseconds) {
        super(startedTimeoutMilliseconds, completedTimeoutMilliseconds);
    }
    
    @Override
    public void doBeforeJobExecutedAtLastStarted(ShardingContexts shardingContexts) {
        System.out.println("---doBeforeJobExecutedAtLastStarted---" + TimeUtil.date2FormatHHmmss(new Date()));
    }
    
    @Override
    public void doAfterJobExecutedAtLastCompleted(ShardingContexts shardingContexts) {
        System.out.println("---doAfterJobExecutedAtLastCompleted---" + TimeUtil.date2FormatHHmmss(new Date()));
    }
}
